class Bet < ActiveRecord::Base
  belongs_to :player
  belongs_to :table

  def to_stage_json(stage)
    a = '{'
    Bet.find_all_by_stage(stage).each { |bet|
      a<<'"'<<bet.user.login<<'":'<<bet.value<<','
    }
    a.chop if a.last.eql?(',')
    a<<'}'
    return a
  end
end
